<script setup lang="ts">
import { MaterialSearchVO } from '@/api/material/material/types';
import { useVModel } from '@vueuse/core';

const props = defineProps<{
  modelValue?: MaterialSearchVO[] | MaterialSearchVO;
  multiple?: boolean;
  materialId?: string | number | null;
}>();
const emit = defineEmits(['update:modelValue']);
const value = useVModel(props, 'modelValue', emit);
const loading = ref(false);
const config = ref<any[]>([]);
</script>

<template>
  <div>
    <div v-for="(row, index) in config" :key="index">
      <material-supplier-select v-slot="slotProps" v-model="row.supplierId" :material-id="props.materialId" :multiple="false">
        <el-option v-for="item in slotProps.list" :key="item.relId" :label="item.companyName" :value="item.materialId + item.supplierId">
          <span style="float: left; color: var(--el-text-color-secondary); font-size: 13px">
            {{ item.companyName }}
          </span>
          <span style="float: right">{{ item.materialCode }}</span>
        </el-option>
      </material-supplier-select>
    </div>
  </div>
</template>

<style scoped lang="scss"></style>
